import org.junit.jupiter.api.Test
import kotlin.test.assertContentEquals

class ArrayTest {

    @Test
    fun create() {
        val arr = arrayOf(0, 0, 0)
        val arr02 = Array(3) {0}
        assertContentEquals(arr, arr02)
    }

    @Test
    fun test() {
        val arr = arrayOf(1, 2, 3)
        for(i in arr.indices) {
            println(arr[i])
        }

        val arr02 = arrayOf(3, 2, 1)
        arr02.sort()
        assertContentEquals(arr, arr02)

        val lastK = arr.takeLast(2).toTypedArray()
        assertContentEquals(lastK, arrayOf(2, 3))
    }

}